<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        table {
            /*border: 2px solid darkblue;*/
            border-collapse: collapse;
        }
        td, th {
            border: 1px solid lightblue;
            padding: 8px;
        }
    </style>
</head>
<body>
<h1>单个变量</h1>
<div>
{$name}
</div>
<h1>for循环</h1>
<table style="border: 1px">
    <tbody>
    {foreach $list as $key=>$obj}
    <tr>
        <td>{$key}/{$obj.id}</td>
        <td>{$obj.mac_value}</td>
        <td>{$obj.desc}</td>
        <td>{$obj.create_time}</td>
    </tr>
    {/foreach}
    </tbody>
</table>
<h1>switch</h1>
<div>
    {switch $status}
    {case 0}默认{/case}
    {case 1}审核中{/case}
    {case 2}已通过{/case}
    {default/}位置
    {/switch}
</div>
<h1>比较</h1>
<div>
    {if $age < 18}少年{/if}
    {if $age >= 18 && $age <30}青年{/if}
    {if $age >=30}中老年{/if}
</div>
<h1>使用函数</h1>
<div>
    {$name|upper}
    <br>
    {$name|lower}
    <br>
    <?php echo strtoupper($name)?>
    <br>
    {$age|date='Y-m-d H:i:s'}
</div>
</body>
</html>